﻿using Microsoft.WindowsAzure.MobileServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace WCFServiceModel.Model
{
  public   class Application
    {
        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }
        private string _name;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private IMobileServiceTable<Application> applicationTable = ServiceManager.getCurrentContext().GetTable<Application>();


        public Application()
        {

        }
        public Application(string name,User u)
        {
            Name = name;
            InsertApplication();
        }

        //add business logic
        private async void InsertApplication()
        {
            await applicationTable.InsertAsync(this);
            
        }

    }
}
